package com.yoyo.yyadsdk.open;

import android.content.Context;
import android.content.Intent;
import android.content.pm.IPackageInstallObserver;
import android.content.pm.IPackageInstallObserver2;
import android.os.Bundle;

public class MyPackageInstallObserver2 extends IPackageInstallObserver2.Stub {
    private Context mContext;

    public MyPackageInstallObserver2(Context context) {
        mContext = context;
    }

    @Override
    public void onUserActionRequired(Intent intent) {

    }

    @Override
    public void onPackageInstalled(String basePackageName, int returnCode, String msg, Bundle extras) {
        // 返回1代表安装成功
        if (returnCode == 1) {
            Intent intent = new Intent("com.yoyo.yyadsdk.broad.StartBroadcastReceiver");
            mContext.sendBroadcast(intent);
        }

    }
}